﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x02000310 RID: 784
	public class TMergeWhenClause : TParseTreeNode
	{
		// Token: 0x1700065E RID: 1630
		// (get) Token: 0x06001BCE RID: 7118 RVA: 0x0032FAF4 File Offset: 0x0032DCF4
		// (set) Token: 0x06001BCD RID: 7117 RVA: 0x0032FAEB File Offset: 0x0032DCEB
		public virtual TExpression Condition
		{
			get
			{
				return this.condition;
			}
			set
			{
				this.condition = value;
			}
		}

		// Token: 0x1700065F RID: 1631
		// (set) Token: 0x06001BCF RID: 7119 RVA: 0x0032FAFC File Offset: 0x0032DCFC
		private TDummy MatchCondition
		{
			set
			{
				this.type = value.int1;
				if (this.type == 3 || this.type == 4)
				{
					this.condition = (TExpression)value.node1;
				}
			}
		}

		// Token: 0x17000660 RID: 1632
		// (get) Token: 0x06001BD0 RID: 7120 RVA: 0x0032FB2D File Offset: 0x0032DD2D
		// (set) Token: 0x06001BD1 RID: 7121 RVA: 0x0032FB35 File Offset: 0x0032DD35
		public virtual int Type
		{
			get
			{
				return this.type;
			}
			set
			{
				this.type = value;
			}
		}

		// Token: 0x17000661 RID: 1633
		// (get) Token: 0x06001BD2 RID: 7122 RVA: 0x0032FB3E File Offset: 0x0032DD3E
		// (set) Token: 0x06001BD3 RID: 7123 RVA: 0x0032FB46 File Offset: 0x0032DD46
		public virtual TMergeUpdateClause UpdateClause
		{
			get
			{
				return this.updateClause;
			}
			set
			{
				this.updateClause = value;
			}
		}

		// Token: 0x17000662 RID: 1634
		// (get) Token: 0x06001BD4 RID: 7124 RVA: 0x0032FB4F File Offset: 0x0032DD4F
		// (set) Token: 0x06001BD5 RID: 7125 RVA: 0x0032FB57 File Offset: 0x0032DD57
		public virtual TMergeDeleteClause DeleteClause
		{
			get
			{
				return this.deleteClause;
			}
			set
			{
				this.deleteClause = value;
			}
		}

		// Token: 0x17000663 RID: 1635
		// (get) Token: 0x06001BD6 RID: 7126 RVA: 0x0032FB60 File Offset: 0x0032DD60
		// (set) Token: 0x06001BD7 RID: 7127 RVA: 0x0032FB68 File Offset: 0x0032DD68
		public virtual TMergeInsertClause InsertClause
		{
			get
			{
				return this.insertClause;
			}
			set
			{
				this.insertClause = value;
			}
		}

		// Token: 0x06001BD8 RID: 7128 RVA: 0x0032FB74 File Offset: 0x0032DD74
		public override void init(object arg1, object arg2)
		{
			if (arg1 != null)
			{
				this.MatchCondition = (TDummy)arg1;
			}
			if (arg2 != null)
			{
				if (arg2 is TMergeUpdateClause)
				{
					this.updateClause = (TMergeUpdateClause)arg2;
					return;
				}
				if (arg2 is TMergeInsertClause)
				{
					this.insertClause = (TMergeInsertClause)arg2;
					return;
				}
				if (arg2 is TMergeDeleteClause)
				{
					this.deleteClause = (TMergeDeleteClause)arg2;
				}
			}
		}

		// Token: 0x06001BD9 RID: 7129 RVA: 0x0032FBD4 File Offset: 0x0032DDD4
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			if (this.condition != null)
			{
				this.condition.doParse(psql, plocation);
			}
			if (this.updateClause != null)
			{
				this.updateClause.doParse(psql, plocation);
			}
			if (this.insertClause != null)
			{
				this.insertClause.doParse(psql, plocation);
			}
			if (this.deleteClause != null)
			{
				this.deleteClause.doParse(psql, plocation);
			}
		}

		// Token: 0x06001BDA RID: 7130 RVA: 0x0032FC35 File Offset: 0x0032DE35
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001BDB RID: 7131 RVA: 0x0032FC48 File Offset: 0x0032DE48
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.condition != null)
			{
				this.condition.acceptChildren(v);
			}
			if (this.updateClause != null)
			{
				this.updateClause.acceptChildren(v);
			}
			if (this.insertClause != null)
			{
				this.insertClause.acceptChildren(v);
			}
			if (this.deleteClause != null)
			{
				this.deleteClause.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001A0F RID: 6671
		public const int matched = 1;

		// Token: 0x04001A10 RID: 6672
		public const int not_matched = 2;

		// Token: 0x04001A11 RID: 6673
		public const int matched_with_condition = 3;

		// Token: 0x04001A12 RID: 6674
		public const int not_matched_with_condition = 4;

		// Token: 0x04001A13 RID: 6675
		public const int not_matched_by_target = 5;

		// Token: 0x04001A14 RID: 6676
		public const int not_matched_by_target_with_condition = 6;

		// Token: 0x04001A15 RID: 6677
		public const int not_matched_by_source = 7;

		// Token: 0x04001A16 RID: 6678
		public const int not_matched_by_source_with_condition = 8;

		// Token: 0x04001A17 RID: 6679
		private int type = 1;

		// Token: 0x04001A18 RID: 6680
		private TExpression condition;

		// Token: 0x04001A19 RID: 6681
		private TMergeUpdateClause updateClause;

		// Token: 0x04001A1A RID: 6682
		private TMergeInsertClause insertClause;

		// Token: 0x04001A1B RID: 6683
		private TMergeDeleteClause deleteClause;
	}
}
